<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>gem5运行SPECCPU2006benchmark | Tom's develop Blog</title><meta name="keywords" content="gem5,GEM5,SPECCPU2006,spec,benchmark"><meta name="author" content="Tom"><meta name="copyright" content="Tom"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="如何在GEM5中运行SPECCPU 2006benchmark,实现两个平台的协同仿真">
<meta property="og:type" content="article">
<meta property="og:title" content="gem5运行SPECCPU2006benchmark">
<meta property="og:url" content="https://tomsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/index.html">
<meta property="og:site_name" content="Tom&#39;s develop Blog">
<meta property="og:description" content="如何在GEM5中运行SPECCPU 2006benchmark,实现两个平台的协同仿真">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5运行SPECCPU2006benchmark/figure2.png">
<meta property="article:published_time" content="2020-09-22T13:55:33.000Z">
<meta property="article:modified_time" content="2021-06-12T11:28:59.998Z">
<meta property="article:author" content="Tom">
<meta property="article:tag" content="GEM5">
<meta property="article:tag" content="CCPU2006">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5运行SPECCPU2006benchmark/figure2.png"><link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avatar.png"><link rel="canonical" href="https://tomsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="preconnect" href="//zz.bdstatic.com"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: Tom","link":"链接: ","source":"来源: Tom's develop Blog","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  ClickShowText: {"text":"富强,民主,文明,和谐,自由,平等,公正,法治,爱国,敬业,诚信,友善","fontSize":"15px"},
  lightbox: 'mediumZoom',
  Snackbar: undefined,
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-06-12 19:28:59'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'true'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }})()</script><meta name="generator" content="Hexo 5.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avator.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">38</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">73</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5运行SPECCPU2006benchmark/figure2.png)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Tom's develop Blog</a></span><span id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">gem5运行SPECCPU2006benchmark</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-09-22T13:55:33.000Z" title="发表于 2020-09-22 21:55:33">2020-09-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-06-12T11:28:59.998Z" title="更新于 2021-06-12 19:28:59">2021-06-12</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/GEM5/">GEM5</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">7k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>40分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/#post-comment"><span class="gitalk-comment-count comment-count"></span></a></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="gem5运行SPECCPU-2006benchmark"><a href="#gem5运行SPECCPU-2006benchmark" class="headerlink" title="gem5运行SPECCPU 2006benchmark"></a><strong>gem5运行SPECCPU 2006benchmark</strong></h1><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a><strong>前言</strong></h2><p>&emsp;最近在做实验，准备在GEM5中运行SPECCPU 2006的benchmark。</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/figure1.png" alt="figure1.png"></p>
<h2 id="系统环境配置"><a href="#系统环境配置" class="headerlink" title="系统环境配置"></a><strong>系统环境配置</strong></h2><p>&emsp;<strong>硬件：</strong> CPU I5-4500 4核 内存8G 硬盘 1T<br>&emsp;<strong>软件：</strong> Ubuntu 18.04 LTS GCC/G++5.5 python2.7 gem5 20.0.0.3</p>
<h2 id="编译安装"><a href="#编译安装" class="headerlink" title="编译安装"></a><strong>编译安装</strong></h2><p>&emsp;<a target="_blank" rel="noopener" href="http://www.gem5.org/documentation/learning_gem5/part1/building/">GEM5基本安装运行</a></p>
<p>&emsp;<a target="_blank" rel="noopener" href="https://www.spec.org/cpu2006/Docs/">SPEC CPU 2006 benchmark基本安装运行</a></p>
<p>&emsp;<a target="_blank" rel="noopener" href="https://www.spec.org/cpu2006/Docs/runspec.html">SPEC runspec命令</a><br>该命令是用来编译和运行spec cpu 2006的。</p>
<h2 id="协同仿真"><a href="#协同仿真" class="headerlink" title="协同仿真"></a><strong>协同仿真</strong></h2><p>目前已编译成功并运行的benchmark</p>
<table>
<thead>
<tr>
<th align="center">int benchmark</th>
<th align="center">language</th>
<th align="center">success(true or false)</th>
</tr>
</thead>
<tbody><tr>
<td align="center">400.perlbench</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">401.bzip2</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">403.gcc</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">429.mcf</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">445.gobmk</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">456.hmmer</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">458.sjeng</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">462.libquantum</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">464.h264ref</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">471.omnetpp</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">473.astar</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">483.xalancbmk</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th align="center">fp benchmark</th>
<th align="center">language</th>
<th align="center">success(true or false)</th>
</tr>
</thead>
<tbody><tr>
<td align="center">410.bwaves</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">416.gamess</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">433.milc</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">434.zeusmp</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">435.gromacs</td>
<td align="center">C/Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">436.cactusADM</td>
<td align="center">C/Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">437.leslie3d</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">444.namd</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">447.dealII</td>
<td align="center">C++</td>
<td align="center">false</td>
</tr>
<tr>
<td align="center">450.soploex</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">453.povray</td>
<td align="center">C++</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">454.calculix</td>
<td align="center">C/Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">459.GemsFDTD</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">465.tonto</td>
<td align="center">Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">470.lbm</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">481.wrf</td>
<td align="center">C/Fortran</td>
<td align="center">true</td>
</tr>
<tr>
<td align="center">482.sphinx3</td>
<td align="center">C</td>
<td align="center">true</td>
</tr>
</tbody></table>
<h3 id="gem5-SE-FS-仿真模式"><a href="#gem5-SE-FS-仿真模式" class="headerlink" title="gem5 SE/FS 仿真模式"></a><strong>gem5 SE/FS 仿真模式</strong></h3><p>gem5有系统调用仿真模式（System Call Emulation (SE) Mode）和全系统仿真模式（Full System (FS) Mode）。可以支持从CPU到内外存的全系统体系结构仿真。你可以根据自己的需要对GEM5源码做相应的扩展，然后运行SE/FS仿真。</p>
<h4 id="运行仿真的格式"><a href="#运行仿真的格式" class="headerlink" title="运行仿真的格式"></a><strong>运行仿真的格式</strong></h4><figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="comment"># &lt;gem5 binary&gt; [gem5 options] &lt;simulation script&gt; [script options]</span></span><br></pre></td></tr></table></figure>

<p>每个仿真包括一个基于特定体系结构编译的gem5二进制和一个仿真python script，以及相应的options。</p>
<h4 id="gem5-Options"><a href="#gem5-Options" class="headerlink" title="gem5 Options"></a><strong>gem5 Options</strong></h4><p>使用”gem5 binary -h”查看options,例如：</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"> <span class="comment"># build/X86/gem5.opt -h</span></span><br><span class="line">Usage</span><br><span class="line">=====</span><br><span class="line">  gem5.opt [gem5 options] script.py [script options]</span><br><span class="line"></span><br><span class="line">gem5 is copyrighted software; use the --copyright option <span class="keyword">for</span> details.</span><br><span class="line">Options</span><br><span class="line">=======</span><br><span class="line">--version               show programm<span class="string">&#x27;s version number and exit</span></span><br><span class="line"><span class="string">--help, -h              show this help message and exit</span></span><br><span class="line"><span class="string">--build-info, -B        Show build information</span></span><br><span class="line"><span class="string">--copyright, -C         Show full copyright information</span></span><br><span class="line"><span class="string">--readme, -R            Show the readme</span></span><br><span class="line"><span class="string">--outdir=DIR, -d DIR    Set the output directory to DIR [Default: m5out]</span></span><br><span class="line"><span class="string">--redirect-stdout, -r   Redirect stdout (&amp; stderr, without -e) to file</span></span><br><span class="line"><span class="string">--redirect-stderr, -e   Redirect stderr to file</span></span><br><span class="line"><span class="string">--stdout-file=FILE      Filename for -r redirection [Default: simout]</span></span><br><span class="line"><span class="string">--stderr-file=FILE      Filename for -e redirection [Default: simerr]</span></span><br><span class="line"><span class="string">--listener-mode=&#123;on,off,auto&#125;</span></span><br><span class="line"><span class="string">                        Port (e.g., gdb) listener mode (auto: Enable if</span></span><br><span class="line"><span class="string">                        running interactively) [Default: auto]</span></span><br><span class="line"><span class="string">--listener-loopback-only</span></span><br><span class="line"><span class="string">                        Port listeners will only accept connections over the</span></span><br><span class="line"><span class="string">                        loopback device</span></span><br><span class="line"><span class="string">--interactive, -i       Invoke the interactive interpreter after running the</span></span><br><span class="line"><span class="string">                        script</span></span><br><span class="line"><span class="string">--pdb                   Invoke the python debugger before running the script</span></span><br><span class="line"><span class="string">--path=PATH[:PATH], -p PATH[:PATH]</span></span><br><span class="line"><span class="string">                        Prepend PATH to the system path when invoking the</span></span><br><span class="line"><span class="string">                        script</span></span><br><span class="line"><span class="string">--quiet, -q             Reduce verbosity</span></span><br><span class="line"><span class="string">--verbose, -v           Increase verbosity</span></span><br><span class="line"><span class="string">...</span></span><br></pre></td></tr></table></figure>

<h4 id="Script-Options"><a href="#Script-Options" class="headerlink" title="Script Options"></a><strong>Script Options</strong></h4><p>gem5已经提供了很多实例的运行脚本，存在$gem5path/config/example/路径下，其中包括运行SE和FS模式的脚本se.py和fs.py。下面是se.py的options。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">Usage: se.py [options]</span><br><span class="line"></span><br><span class="line">Options:</span><br><span class="line">  -h, --<span class="built_in">help</span>            show this <span class="built_in">help</span> message and <span class="built_in">exit</span></span><br><span class="line">  -n NUM_CPUS, --num-cpus=NUM_CPUS</span><br><span class="line">  --sys-voltage=SYS_VOLTAGE</span><br><span class="line">                        Top-level voltage <span class="keyword">for</span> blocks running at system</span><br><span class="line">                        power supply</span><br><span class="line">  --sys-clock=SYS_CLOCK</span><br><span class="line">                        Top-level clock <span class="keyword">for</span> blocks running at system</span><br><span class="line">                        speed</span><br><span class="line">  --list-mem-types      List available memory types</span><br><span class="line">  --mem-type=MEM_TYPE   <span class="built_in">type</span> of memory to use</span><br><span class="line">  --mem-channels=MEM_CHANNELS</span><br><span class="line">                        number of memory channels</span><br><span class="line">  --mem-ranks=MEM_RANKS</span><br><span class="line">                        number of memory ranks per channel</span><br><span class="line">  --mem-size=MEM_SIZE   Specify the physical memory size (single memory)</span><br><span class="line">  --enable-dram-powerdown</span><br><span class="line">                        Enable low-power states <span class="keyword">in</span> DRAMCtrl</span><br><span class="line">  --mem-channels-intlv=MEM_CHANNELS_INTLV</span><br><span class="line">                        Memory channels interleave</span><br><span class="line">  --memchecker</span><br><span class="line">  --external-memory-system=EXTERNAL_MEMORY_SYSTEM</span><br><span class="line">                        use external ports of this port_type <span class="keyword">for</span> caches</span><br><span class="line">  --tlm-memory=TLM_MEMORY</span><br><span class="line">                        use external port <span class="keyword">for</span> SystemC TLM cosimulation</span><br><span class="line">  --caches</span><br><span class="line">  --l2cache</span><br><span class="line">  --num-dirs=NUM_DIRS</span><br><span class="line">  --num-l2caches=NUM_L2CACHES</span><br><span class="line">  --num-l3caches=NUM_L3CACHES</span><br><span class="line">  --l1d_size=L1D_SIZE</span><br><span class="line">  --l1i_size=L1I_SIZE</span><br><span class="line">  --l2_size=L2_SIZE</span><br><span class="line">  --l3_size=L3_SIZE</span><br><span class="line">  --l1d_assoc=L1D_ASSOC</span><br><span class="line">  --l1i_assoc=L1I_ASSOC</span><br><span class="line">  --l2_assoc=L2_ASSOC</span><br><span class="line">  --l3_assoc=L3_ASSOC</span><br><span class="line">  --cacheline_size=CACHELINE_SIZE</span><br><span class="line">  --ruby</span><br><span class="line">  ......</span><br><span class="line"></span><br><span class="line">  -c CMD, --cmd=CMD     The binary to run <span class="keyword">in</span> syscall emulation mode.</span><br><span class="line">  -o OPTIONS, --options=OPTIONS</span><br><span class="line">                        The options to pass to the binary, use <span class="string">&quot; &quot;</span></span><br><span class="line">                        around the entire string</span><br><span class="line">  -e ENV, --env=ENV     Initialize workload environment from text file.</span><br><span class="line">  -i INPUT, --input=INPUT</span><br><span class="line">                        Read stdin from a file.</span><br><span class="line">  --output=OUTPUT       Redirect stdout to a file.</span><br><span class="line">  --errout=ERROUT       Redirect stderr to a file.</span><br><span class="line">  ......</span><br></pre></td></tr></table></figure>

<h3 id="spec-cpu2006静态编译"><a href="#spec-cpu2006静态编译" class="headerlink" title="spec cpu2006静态编译"></a><strong>spec cpu2006静态编译</strong></h3><p>spec cpu 2006benchmark 使用命令<a target="_blank" rel="noopener" href="https://www.spec.org/cpu2006/Docs/runspec.html">runspec</a>来进行编译和运行。</p>
<p>runspec命令使用一个以.cfg结尾的配置文件来对benchmark进行编译。默认在$spec安装目录/config/ 下提供了一些配置文件的实例，可以根据需要对其进行修改。</p>
<p>要使spec cpu 2006的bench能在gem5里运行，需要对每个bench进行静态编译。对于配置文件主要做如下的更改：</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="comment">## Base is low opt</span></span><br><span class="line">default=base=default=default:</span><br><span class="line">COPTIMIZE    = -O2 -fno-strict-aliasing</span><br><span class="line">CXXOPTIMIZE  = -O2 -fno-strict-aliasing</span><br><span class="line">FOPTIMIZE    = -O2 -fno-strict-aliasing</span><br><span class="line"></span><br><span class="line">改为</span><br><span class="line">COPTIMIZE    = -O2 -fno-strict-aliasing -static</span><br><span class="line">CXXOPTIMIZE  = -O2 -fno-strict-aliasing -static</span><br><span class="line">FOPTIMIZE    = -O2 -fno-strict-aliasing -static</span><br></pre></td></tr></table></figure>

<h3 id="运行一个例子"><a href="#运行一个例子" class="headerlink" title="运行一个例子"></a><strong>运行一个例子</strong></h3><h4 id="runspec运行"><a href="#runspec运行" class="headerlink" title="runspec运行"></a><strong>runspec运行</strong></h4><p> 编译并运行一个bench,以401.bzip2为例</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="comment"># 编译perlbench</span></span><br><span class="line">runspec --config=xxx.cfg --action=build --tune=base bzip2</span><br><span class="line"><span class="comment">#运行perlbench</span></span><br><span class="line">runspec --config=xxx.cfg --size=ref -I --tune=base bzip2</span><br></pre></td></tr></table></figure>

<p>这里的xxx.cfg是对应的配置文件，指定了包括编译和运行SPEC CPU的环境参数。还可以使用int,fp,all来替代bzip2编译或运行整型bench，浮点或所有bench。</p>
<h4 id="二进制运行"><a href="#二进制运行" class="headerlink" title="二进制运行"></a><strong>二进制运行</strong></h4><p>当编译一个bench会在对应目录下生成一个run子文件夹，里面包含编译生成的可执行文件和对应的输入。想了解每个bench 到底做了什么可以直接运行这个可执行文件。以bzip2为例</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="built_in">cd</span> <span class="variable">$PATH_TO_YOUR_SPEC_CPU2006_INSTALL</span>/benchspec/CPU2006/401. bzip2/run/run__base.amd64-m64-gcc43-nn.0000/</span><br><span class="line"></span><br><span class="line">./bzip2_base.amd64-m64-gcc43-nn control</span><br></pre></td></tr></table></figure>

<p>对于不同的bench，有不同的运行输入，具体可见<a target="_blank" rel="noopener" href="https://www.spec.org/cpu2006/Docs/">官方说明</a>或安装目录下每个bench下的Docs子文件夹。要使这些bench在gem5中被正确地执行，指定正确的输入是很重要的。否则即使能跑起来也没有正确的输入。使用runspec运行bench 只需要使用–size选项来指定输入就好了。</p>
<h4 id="GEM5运行"><a href="#GEM5运行" class="headerlink" title="GEM5运行"></a><strong>GEM5运行</strong></h4><p>接下来在gem5中运行一个bench，还是以bzip2为例。使用config/example/se.py作为配置文件。命令很长，将其写成shell 脚本。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment">#run_bzip2.sh</span></span><br><span class="line">gem5path=/home/tom/gem5</span><br><span class="line">spec2006path=<span class="variable">$gem5path</span>/cpu2006/benchspec/CPU2006</span><br><span class="line">outdir=/home/tom/Desktop/spec2006Trace</span><br><span class="line">bench=401.bzip2</span><br><span class="line">ben_suffix=run/run_base.amd64-m64-gcc43-nn.0000/</span><br><span class="line">exe=bzip_base.amd64-m64-gcc43-nn</span><br><span class="line"></span><br><span class="line"><span class="variable">$gem5path</span>/build/X86/gem5.opt \</span><br><span class="line">--debug-flags=MemoryAccess \</span><br><span class="line">--outdir=<span class="variable">$outdir</span> --debug-file=401.bzip2.out \</span><br><span class="line"><span class="variable">$gem5path</span>/configs/example/se.py \</span><br><span class="line">-c <span class="string">&quot;<span class="variable">$spec2006path</span>/<span class="variable">$bench</span>/<span class="variable">$ben_suffix</span>/<span class="variable">$exe</span>&quot;</span> \</span><br><span class="line">-o <span class="string">&quot;&quot;</span> \</span><br><span class="line">-i <span class="string">&quot;<span class="variable">$spec2006path</span>/<span class="variable">$bench</span>/<span class="variable">$ben_suffix</span>/control&quot;</span> \</span><br><span class="line">--cpu-nums=1 \</span><br><span class="line">--cpu-type=TimingSimpleCPU \</span><br><span class="line">--caches \</span><br><span class="line">--cacheline_size=64 \</span><br><span class="line">--l1d_size=64kB --l1i_size=32kB --l1i_assoc=8 --l1d_assoc=8 \</span><br><span class="line">--l2cache --l2_size=2MB --l2_assoc=8 \</span><br><span class="line">--l3_size=32MB --l3_assoc=4 \</span><br><span class="line">--mem-size=4096MB</span><br></pre></td></tr></table></figure>

<p> 其中的几个参数解释如下：</p>
<ul>
<li><p>-c 指定gem5运行的二进制文件</p>
</li>
<li><p>-o 运行二进制文件的选项</p>
</li>
<li><p>-i 二进制文件的输入文件，把文件当成输入</p>
<p>要想运行其余的bench,主要改动这三个选项。</p>
</li>
</ul>
<h3 id="自动化脚本"><a href="#自动化脚本" class="headerlink" title="自动化脚本"></a><strong>自动化脚本</strong></h3><p>显然，对于每个bench都写一个shell太麻烦了，每个bench还需要指定不同的输入，而且没办法同时运行个bench进行多线程仿真。考虑用python脚本来解决这个问题。参考了网上的做法，但是都是将bench当成单线程来模拟，并没有提供多线程的解决方案。参考<a target="_blank" rel="noopener" href="https://markgottscho.wordpress.com/2014/09/20/tutorial-easily-running-spec-cpu2006-benchmarks-in-the-gem5-simulator/">现有方案</a>，在此基础上写了一个同时支持单线程和多线程的版本。</p>
<h4 id="配置文件spec06-config-py"><a href="#配置文件spec06-config-py" class="headerlink" title="配置文件spec06_config.py"></a><strong>配置文件spec06_config.py</strong></h4><p>首先，从config/example/se.py配置文件中复制一个配置文件spec_config.py。并对其进行更改。</p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment"># Copyright (c) 2012-2013 ARM Limited</span></span><br><span class="line"><span class="comment"># All rights reserved.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># The license below extends only to copyright in the software and shall</span></span><br><span class="line"><span class="comment"># not be construed as granting a license to any other intellectual</span></span><br><span class="line"><span class="comment"># property including but not limited to intellectual property relating</span></span><br><span class="line"><span class="comment"># to a hardware implementation of the functionality of the software</span></span><br><span class="line"><span class="comment"># licensed hereunder.  You may use the software subject to the license</span></span><br><span class="line"><span class="comment"># terms below provided that you ensure that this notice is replicated</span></span><br><span class="line"><span class="comment"># unmodified and in its entirety in all distributions of the software,</span></span><br><span class="line"><span class="comment"># modified or unmodified, in source code or in binary form.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># Copyright (c) 2006-2008 The Regents of The University of Michigan</span></span><br><span class="line"><span class="comment"># All rights reserved.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># Redistribution and use in source and binary forms, with or without</span></span><br><span class="line"><span class="comment"># modification, are permitted provided that the following conditions are</span></span><br><span class="line"><span class="comment"># met: redistributions of source code must retain the above copyright</span></span><br><span class="line"><span class="comment"># notice, this list of conditions and the following disclaimer;</span></span><br><span class="line"><span class="comment"># redistributions in binary form must reproduce the above copyright</span></span><br><span class="line"><span class="comment"># notice, this list of conditions and the following disclaimer in the</span></span><br><span class="line"><span class="comment"># documentation and/or other materials provided with the distribution;</span></span><br><span class="line"><span class="comment"># neither the name of the copyright holders nor the names of its</span></span><br><span class="line"><span class="comment"># contributors may be used to endorse or promote products derived from</span></span><br><span class="line"><span class="comment"># this software without specific prior written permission.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></span><br><span class="line"><span class="comment"># &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></span><br><span class="line"><span class="comment"># LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span></span><br><span class="line"><span class="comment"># A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT</span></span><br><span class="line"><span class="comment"># OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span></span><br><span class="line"><span class="comment"># SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span></span><br><span class="line"><span class="comment"># LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></span><br><span class="line"><span class="comment"># DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></span><br><span class="line"><span class="comment"># THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></span><br><span class="line"><span class="comment"># (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span></span><br><span class="line"><span class="comment"># OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Simple test script</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># &quot;m5 test.py&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> __future__ <span class="keyword">import</span> print_function</span><br><span class="line"><span class="keyword">from</span> __future__ <span class="keyword">import</span> absolute_import</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> optparse</span><br><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> m5</span><br><span class="line"><span class="keyword">from</span> m5.defines <span class="keyword">import</span> buildEnv</span><br><span class="line"><span class="keyword">from</span> m5.objects <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> m5.params <span class="keyword">import</span> NULL</span><br><span class="line"><span class="keyword">from</span> m5.util <span class="keyword">import</span> addToPath, fatal, warn</span><br><span class="line"></span><br><span class="line">addToPath(<span class="string">&#x27;../&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> ruby <span class="keyword">import</span> Ruby</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> Options</span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> Simulation</span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> CacheConfig</span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> CpuConfig</span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> ObjectList</span><br><span class="line"><span class="keyword">from</span> common <span class="keyword">import</span> MemConfig</span><br><span class="line"><span class="keyword">from</span> common.FileSystemConfig <span class="keyword">import</span> config_filesystem</span><br><span class="line"><span class="keyword">from</span> common.Caches <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> common.cpu2000 <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">import</span> spec06_benchmarks</span><br><span class="line"></span><br><span class="line"><span class="comment"># ...snip...</span></span><br><span class="line">parser = optparse.OptionParser()</span><br><span class="line">Options.addCommonOptions(parser)</span><br><span class="line">Options.addSEOptions(parser)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># NAVIGATE TO THIS POINT</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># ...snip...</span></span><br><span class="line"></span><br><span class="line">parser.add_option(<span class="string">&quot;-b&quot;</span>, <span class="string">&quot;--benchmark&quot;</span>, <span class="built_in">type</span>=<span class="string">&quot;string&quot;</span>, default=<span class="string">&quot;&quot;</span>, <span class="built_in">help</span>=<span class="string">&quot;The SPEC benchmark to be loaded.&quot;</span>)</span><br><span class="line">parser.add_option(<span class="string">&quot;--benchmark_stdout&quot;</span>, <span class="built_in">type</span>=<span class="string">&quot;string&quot;</span>, default=<span class="string">&quot;&quot;</span>, <span class="built_in">help</span>=<span class="string">&quot;Absolute path for stdout redirection for the benchmark.&quot;</span>)</span><br><span class="line">parser.add_option(<span class="string">&quot;--benchmark_stderr&quot;</span>, <span class="built_in">type</span>=<span class="string">&quot;string&quot;</span>, default=<span class="string">&quot;&quot;</span>, <span class="built_in">help</span>=<span class="string">&quot;Absolute path for stderr redirection for the benchmark.&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">get_processes</span>(<span class="params">options</span>):</span></span><br><span class="line">    <span class="string">&quot;&quot;&quot;Interprets provided options and returns a list of processes&quot;&quot;&quot;</span></span><br><span class="line"></span><br><span class="line">    multiprocesses = []</span><br><span class="line">    outputs = []</span><br><span class="line">    errouts = []</span><br><span class="line"></span><br><span class="line">    workloads = options.benchmark.split(<span class="string">&#x27;;&#x27;</span>)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.benchmark_stdout != <span class="string">&quot;&quot;</span>:</span><br><span class="line">        outputs = options.benchmark_stdout.split(<span class="string">&#x27;;&#x27;</span>)</span><br><span class="line">    <span class="keyword">elif</span> options.output != <span class="string">&quot;&quot;</span>:</span><br><span class="line">        outputs = options.output.split(<span class="string">&#x27;;&#x27;</span>)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.benchmark_stderr != <span class="string">&quot;&quot;</span>:</span><br><span class="line">        errouts = options.benchmark_stderr.split(<span class="string">&#x27;;&#x27;</span>)</span><br><span class="line">    <span class="keyword">elif</span> options.errout != <span class="string">&quot;&quot;</span>:</span><br><span class="line">        errouts = options.errout.split(<span class="string">&#x27;;&#x27;</span>)</span><br><span class="line"></span><br><span class="line">    idx = <span class="number">0</span></span><br><span class="line">    <span class="keyword">for</span> wrkld <span class="keyword">in</span> workloads:</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> wrkld:</span><br><span class="line">            print(<span class="string">&#x27;Selected SPEC_CPU2006 benchmark&#x27;</span>)</span><br><span class="line">            <span class="keyword">if</span> wrkld == <span class="string">&#x27;perlbench&#x27;</span>:</span><br><span class="line">                print(<span class="string">&#x27;--&gt; perlbench&#x27;</span>)</span><br><span class="line">                process = spec06_benchmarks.perlbench</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;bzip2&#x27;</span>:</span><br><span class="line">                print(<span class="string">&#x27;--&gt; bzip2&#x27;</span>)</span><br><span class="line">                process = spec06_benchmarks.bzip2</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;gcc&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; gcc&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.gcc</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;bwaves&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; bwaves&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.bwaves</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;gamess&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; gamess&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.gamess</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;mcf&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; mcf&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.mcf</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;milc&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; milc&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.milc</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;zeusmp&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; zeusmp&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.zeusmp</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;gromacs&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; gromacs&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.gromacs</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;cactusADM&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; cactusADM&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.cactusADM</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;leslie3d&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; leslie3d&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.leslie3d</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;namd&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; namd&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.namd</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;gobmk&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; gobmk&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.gobmk</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;dealII&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; dealII&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.dealII</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;soplex&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; soplex&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.soplex</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;povray&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; povray&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.povray</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;calculix&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; calculix&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.calculix</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;hmmer&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; hmmer&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.hmmer</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;sjeng&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; sjeng&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.sjeng</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;GemsFDTD&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; GemsFDTD&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.GemsFDTD</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;libquantum&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; libquantum&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.libquantum</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;h264ref&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; h264ref&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.h264ref</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;tonto&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; tonto&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.tonto</span><br><span class="line">            <span class="keyword">elif</span> wrkld== <span class="string">&#x27;lbm&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; lbm&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.lbm</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;omnetpp&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; omnetpp&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.omnetpp</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;astar&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; astar&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.astar</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;wrf&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; wrf&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.wrf</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;sphinx3&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; sphinx3&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.sphinx3</span><br><span class="line">            <span class="keyword">elif</span> wrkld== <span class="string">&#x27;xalancbmk&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; xalancbmk&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.xalancbmk</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;specrand_i&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; specrand_i&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.specrand_i</span><br><span class="line">            <span class="keyword">elif</span> wrkld == <span class="string">&#x27;specrand_f&#x27;</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&#x27;--&gt; specrand_f&#x27;</span></span><br><span class="line">                process = spec06_benchmarks.specrand_f</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="built_in">print</span></span><br><span class="line">                <span class="string">&quot;No recognized SPEC2006 benchmark selected! Exiting.&quot;</span></span><br><span class="line">                sys.exit(<span class="number">1</span>)</span><br><span class="line">            process.cwd = os.getcwd()</span><br><span class="line"></span><br><span class="line">            <span class="keyword">if</span> <span class="built_in">len</span>(outputs) &gt; idx:</span><br><span class="line">                process.output = outputs[idx]</span><br><span class="line">            <span class="keyword">if</span> <span class="built_in">len</span>(errouts) &gt; idx:</span><br><span class="line">                process.errout = errouts[idx]</span><br><span class="line"></span><br><span class="line">            multiprocesses.append(process)</span><br><span class="line">            idx += <span class="number">1</span></span><br><span class="line"></span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="built_in">print</span> &gt;&gt; sys.stderr, <span class="string">&quot;Need --benchmark switch to specify SPEC CPU2006 workload. Exiting!\n&quot;</span></span><br><span class="line">            sys.exit(<span class="number">1</span>)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.smt:</span><br><span class="line">        <span class="keyword">assert</span>(options.cpu_type == <span class="string">&quot;DerivO3CPU&quot;</span>)</span><br><span class="line">        <span class="keyword">return</span> multiprocesses, idx</span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        <span class="keyword">return</span> multiprocesses, <span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">#parser = optparse.OptionParser()</span></span><br><span class="line"><span class="comment">#Options.addCommonOptions(parser)</span></span><br><span class="line"><span class="comment">#Options.addSEOptions(parser)</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> <span class="string">&#x27;--ruby&#x27;</span> <span class="keyword">in</span> sys.argv:</span><br><span class="line">    Ruby.define_options(parser)</span><br><span class="line"></span><br><span class="line">(options, args) = parser.parse_args()</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> args:</span><br><span class="line">    print(<span class="string">&quot;Error: script doesn&#x27;t take any positional arguments&quot;</span>)</span><br><span class="line">    sys.exit(<span class="number">1</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">multiprocesses, numThreads = get_processes(options)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)</span><br><span class="line">CPUClass.numThreads = numThreads</span><br><span class="line"></span><br><span class="line"><span class="comment"># Check -- do not allow SMT with multiple CPUs</span></span><br><span class="line"><span class="keyword">if</span> options.smt <span class="keyword">and</span> options.num_cpus &gt; <span class="number">1</span>:</span><br><span class="line">    fatal(<span class="string">&quot;You cannot use SMT with multiple CPUs!&quot;</span>)</span><br><span class="line"></span><br><span class="line">np = options.num_cpus</span><br><span class="line">system = System(cpu = [CPUClass(cpu_id=i) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(np)],</span><br><span class="line">                mem_mode = test_mem_mode,</span><br><span class="line">                mem_ranges = [AddrRange(options.mem_size)],</span><br><span class="line">                cache_line_size = options.cacheline_size,</span><br><span class="line">                workload = NULL)</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> numThreads &gt; <span class="number">1</span>:</span><br><span class="line">    system.multi_thread = <span class="literal">True</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Create a top-level voltage domain</span></span><br><span class="line">system.voltage_domain = VoltageDomain(voltage = options.sys_voltage)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Create a source clock for the system and set the clock period</span></span><br><span class="line">system.clk_domain = SrcClockDomain(clock =  options.sys_clock,</span><br><span class="line">                                   voltage_domain = system.voltage_domain)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Create a CPU voltage domain</span></span><br><span class="line">system.cpu_voltage_domain = VoltageDomain()</span><br><span class="line"></span><br><span class="line"><span class="comment"># Create a separate clock domain for the CPUs</span></span><br><span class="line">system.cpu_clk_domain = SrcClockDomain(clock = options.cpu_clock,</span><br><span class="line">                                       voltage_domain =</span><br><span class="line">                                       system.cpu_voltage_domain)</span><br><span class="line"></span><br><span class="line"><span class="comment"># If elastic tracing is enabled, then configure the cpu and attach the elastic</span></span><br><span class="line"><span class="comment"># trace probe</span></span><br><span class="line"><span class="comment">#if options.elastic_trace_en:</span></span><br><span class="line"><span class="comment">#    CpuConfig.config_etrace(CPUClass, system.cpu, options)</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># All cpus belong to a common cpu_clk_domain, therefore running at a common</span></span><br><span class="line"><span class="comment"># frequency.</span></span><br><span class="line"><span class="keyword">for</span> cpu <span class="keyword">in</span> system.cpu:</span><br><span class="line">    cpu.clk_domain = system.cpu_clk_domain</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> ObjectList.is_kvm_cpu(CPUClass) <span class="keyword">or</span> ObjectList.is_kvm_cpu(FutureClass):</span><br><span class="line">    <span class="keyword">if</span> buildEnv[<span class="string">&#x27;TARGET_ISA&#x27;</span>] == <span class="string">&#x27;x86&#x27;</span>:</span><br><span class="line">        system.kvm_vm = KvmVM()</span><br><span class="line">        <span class="keyword">for</span> process <span class="keyword">in</span> multiprocesses:</span><br><span class="line">            process.useArchPT = <span class="literal">True</span></span><br><span class="line">            process.kvmInSE = <span class="literal">True</span></span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        fatal(<span class="string">&quot;KvmCPU can only be used in SE mode with x86&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Sanity check</span></span><br><span class="line"><span class="keyword">if</span> options.simpoint_profile:</span><br><span class="line">    <span class="keyword">if</span> <span class="keyword">not</span> ObjectList.is_noncaching_cpu(CPUClass):</span><br><span class="line">        fatal(<span class="string">&quot;SimPoint/BPProbe should be done with an atomic cpu&quot;</span>)</span><br><span class="line">    <span class="keyword">if</span> np &gt; <span class="number">1</span>:</span><br><span class="line">        fatal(<span class="string">&quot;SimPoint generation not supported with more than one CPUs&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(np):</span><br><span class="line">    <span class="keyword">if</span> options.smt:</span><br><span class="line">        system.cpu[i].workload = multiprocesses</span><br><span class="line">    <span class="keyword">elif</span> <span class="built_in">len</span>(multiprocesses) == <span class="number">1</span>:</span><br><span class="line">        system.cpu[i].workload = multiprocesses[<span class="number">0</span>]</span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        system.cpu[i].workload = multiprocesses[i]</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.simpoint_profile:</span><br><span class="line">        system.cpu[i].addSimPointProbe(options.simpoint_interval)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.checker:</span><br><span class="line">        system.cpu[i].addCheckerCpu()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.bp_type:</span><br><span class="line">        bpClass = ObjectList.bp_list.get(options.bp_type)</span><br><span class="line">        system.cpu[i].branchPred = bpClass()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> options.indirect_bp_type:</span><br><span class="line">        indirectBPClass = \</span><br><span class="line">            ObjectList.indirect_bp_list.get(options.indirect_bp_type)</span><br><span class="line">        system.cpu[i].branchPred.indirectBranchPred = indirectBPClass()</span><br><span class="line"></span><br><span class="line">    system.cpu[i].createThreads()</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> options.ruby:</span><br><span class="line">    Ruby.create_system(options, <span class="literal">False</span>, system)</span><br><span class="line">    <span class="keyword">assert</span>(options.num_cpus == <span class="built_in">len</span>(system.ruby._cpu_ports))</span><br><span class="line"></span><br><span class="line">    system.ruby.clk_domain = SrcClockDomain(clock = options.ruby_clock,</span><br><span class="line">                                        voltage_domain = system.voltage_domain)</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(np):</span><br><span class="line">        ruby_port = system.ruby._cpu_ports[i]</span><br><span class="line"></span><br><span class="line">        <span class="comment"># Create the interrupt controller and connect its ports to Ruby</span></span><br><span class="line">        <span class="comment"># Note that the interrupt controller is always present but only</span></span><br><span class="line">        <span class="comment"># in x86 does it have message ports that need to be connected</span></span><br><span class="line">        system.cpu[i].createInterruptController()</span><br><span class="line"></span><br><span class="line">        <span class="comment"># Connect the cpu&#x27;s cache ports to Ruby</span></span><br><span class="line">        system.cpu[i].icache_port = ruby_port.slave</span><br><span class="line">        system.cpu[i].dcache_port = ruby_port.slave</span><br><span class="line">        <span class="keyword">if</span> buildEnv[<span class="string">&#x27;TARGET_ISA&#x27;</span>] == <span class="string">&#x27;x86&#x27;</span>:</span><br><span class="line">            system.cpu[i].interrupts[<span class="number">0</span>].pio = ruby_port.master</span><br><span class="line">            system.cpu[i].interrupts[<span class="number">0</span>].int_master = ruby_port.slave</span><br><span class="line">            system.cpu[i].interrupts[<span class="number">0</span>].int_slave = ruby_port.master</span><br><span class="line">            system.cpu[i].itb.walker.port = ruby_port.slave</span><br><span class="line">            system.cpu[i].dtb.walker.port = ruby_port.slave</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    MemClass = Simulation.setMemClass(options)</span><br><span class="line">    system.membus = SystemXBar()</span><br><span class="line">    system.system_port = system.membus.slave</span><br><span class="line">    CacheConfig.config_cache(options, system)</span><br><span class="line">    MemConfig.config_mem(options, system)</span><br><span class="line">    config_filesystem(system, options)</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> options.wait_gdb:</span><br><span class="line">    <span class="keyword">for</span> cpu <span class="keyword">in</span> system.cpu:</span><br><span class="line">        cpu.wait_for_remote_gdb = <span class="literal">True</span></span><br><span class="line"></span><br><span class="line">root = Root(full_system = <span class="literal">False</span>, system = system)</span><br><span class="line">Simulation.run(options, root, system, FutureClass)</span><br></pre></td></tr></table></figure>

<h4 id="bench输入"><a href="#bench输入" class="headerlink" title="bench输入"></a><strong>bench输入</strong></h4><p>然后写一个脚本解决bench的输入问题，并在spec06_config.py中使用。</p>
<figure class="highlight python"><table><tr><td class="code"><pre><span class="line"><span class="comment">##spec06_benchmarks.py</span></span><br><span class="line"><span class="keyword">import</span> m5</span><br><span class="line"><span class="keyword">from</span> m5.objects <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line"><span class="comment"># These three directory paths are not currently used.</span></span><br><span class="line"><span class="comment"># gem5_dir = &#x27;&lt;FULL_PATH_TO_YOUR_GEM5_INSTALL&gt;&#x27;</span></span><br><span class="line"><span class="comment"># spec_dir = &#x27;&lt;FULL_PATH_TO_YOUR_SPEC_CPU2006_INSTALL&gt;&#x27;</span></span><br><span class="line"><span class="comment"># out_dir = &#x27;&lt;FULL_PATH_TO_DESIRED_OUTPUT_DIRECTORY&gt;&#x27;</span></span><br><span class="line"></span><br><span class="line">GEM5_DIR=<span class="string">&#x27;/home/tom/gem5&#x27;</span></span><br><span class="line"><span class="comment">#&lt;PATH_TO_YOUR_GEM5_INSTALL&gt;                          # Install location of gem5</span></span><br><span class="line">SPEC_DIR=<span class="string">&#x27;/home/tom/cpu2006/benchspec/CPU2006/&#x27;</span></span><br><span class="line"></span><br><span class="line">dir_suffix = <span class="string">&#x27;/run/run_base_ref_amd64-m64-gcc43-nn.0000/&#x27;</span></span><br><span class="line">exe_suffix = <span class="string">&#x27;_base.amd64-m64-gcc43-nn&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># temp</span></span><br><span class="line"><span class="comment"># binary_dir = spec_dir</span></span><br><span class="line"><span class="comment"># data_dir = spec_dir</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 400.perlbench</span></span><br><span class="line">perlbench = Process(pid=<span class="number">400</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;400.perlbench&#x27;</span>+dir_suffix</span><br><span class="line">perlbench.executable = fullpath+<span class="string">&#x27;perlbench&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># perlbench.cmd = [perlbench.executable] + [&#x27;-I.&#x27;, fullpath+&#x27;/lib&#x27;,fullpath+ &#x27;attrs.pl&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">perlbench.cmd = [perlbench.executable] + [<span class="string">&#x27;-I&#x27;</span>+fullpath+<span class="string">&#x27;/lib&#x27;</span>, fullpath+<span class="string">&#x27;/checkspam.pl&#x27;</span>, <span class="string">&#x27;2500&#x27;</span>, <span class="string">&#x27;5&#x27;</span>, <span class="string">&#x27;25&#x27;</span>, <span class="string">&#x27;11&#x27;</span>, <span class="string">&#x27;150&#x27;</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;1&#x27;</span>]</span><br><span class="line"><span class="comment"># perlbench.cmd = [perlbench.executable] + [&#x27;-I&#x27;+fullpath+&#x27;/lib&#x27;,fullpath+ &#x27;diffmail.pl&#x27;, &#x27;4&#x27;, &#x27;800&#x27;, &#x27;10&#x27;, &#x27;17&#x27;, &#x27;19&#x27;, &#x27;300&#x27;]</span></span><br><span class="line"><span class="comment"># perlbench.cmd = [perlbench.executable] + [&#x27;-I&#x27;+fullpath+&#x27;/lib&#x27;,fullpath+ &#x27;splitmail.pl&#x27;, &#x27;1600&#x27;, &#x27;12&#x27;, &#x27;26&#x27;, &#x27;16&#x27;, &#x27;4500&#x27;]</span></span><br><span class="line"><span class="comment"># perlbench.output = out_dir+&#x27;perlbench.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 401.bzip2</span></span><br><span class="line">bzip2 = Process(pid=<span class="number">401</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;401.bzip2&#x27;</span>+dir_suffix</span><br><span class="line">bzip2.executable = fullpath+<span class="string">&#x27;bzip2&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;input.program&#x27;, &#x27;5&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">bzip2.cmd = [bzip2.executable] + [fullpath+<span class="string">&#x27;input.source&#x27;</span>, <span class="string">&#x27;280&#x27;</span>]</span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;chicken.jpg&#x27;, &#x27;30&#x27;]</span></span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;liberty.jpg&#x27;, &#x27;30&#x27;]</span></span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;input.program&#x27;, &#x27;280&#x27;]</span></span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;text.html&#x27;, &#x27;280&#x27;]</span></span><br><span class="line"><span class="comment"># bzip2.cmd = [bzip2.executable] + [fullpath+&#x27;input.combined&#x27;, &#x27;200&#x27;]</span></span><br><span class="line"><span class="comment"># bzip2.output = out_dir + &#x27;bzip2.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 403.gcc</span></span><br><span class="line">gcc = Process(pid=<span class="number">403</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;403.gcc&#x27;</span>+dir_suffix</span><br><span class="line">gcc.executable = fullpath+<span class="string">&#x27;gcc&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;cccp.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;cccp.s&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">gcc.cmd = [gcc.executable] + [fullpath+<span class="string">&#x27;166.i&#x27;</span>, <span class="string">&#x27;-o&#x27;</span>, fullpath+<span class="string">&#x27;166.s&#x27;</span>]</span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;200.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;200.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;c-typeck.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;c-typeck.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;cp-decl.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;cp-decl.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;expr.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;expr.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;expr2.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;expr2.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;g23.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;g23.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;s04.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;s04.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.cmd = [gcc.executable] + [fullpath+&#x27;scilab.i&#x27;, &#x27;-o&#x27;,fullpath+ &#x27;scilab.s&#x27;]</span></span><br><span class="line"><span class="comment"># gcc.output = out_dir + &#x27;gcc.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 410.bwaves</span></span><br><span class="line">bwaves = Process(pid=<span class="number">410</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;410.bwaves&#x27;</span>+dir_suffix</span><br><span class="line">bwaves.executable = fullpath+<span class="string">&#x27;bwaves&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># bwaves.cmd = [bwaves.executable]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">bwaves.cmd = [bwaves.executable]</span><br><span class="line"><span class="comment"># bwaves.output = out_dir + &#x27;bwaves.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 416.gamess</span></span><br><span class="line">gamess = Process(pid=<span class="number">416</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;416.gamess&#x27;</span>+dir_suffix</span><br><span class="line">gamess.executable = fullpath+<span class="string">&#x27;gamess&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># gamess.cmd = [gamess.executable]</span></span><br><span class="line"><span class="comment"># gamess.input = fullpath+&#x27;exam29.config&#x27;</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">gamess.cmd = [gamess.executable]</span><br><span class="line">gamess.<span class="built_in">input</span> = fullpath+<span class="string">&#x27;cytosine.2.config&#x27;</span></span><br><span class="line"><span class="comment"># gamess.cmd = [gamess.executable]</span></span><br><span class="line"><span class="comment"># gamess.input = fullpath+&#x27;h2ocu2+.gradient.config&#x27;</span></span><br><span class="line"><span class="comment"># gamess.cmd = [gamess.executable]</span></span><br><span class="line"><span class="comment"># gamess.input = fullpath+&#x27;triazolium.config&#x27;</span></span><br><span class="line"><span class="comment"># gamess.output = out_dir + &#x27;gamess.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 429.mcf</span></span><br><span class="line">mcf = Process(pid=<span class="number">429</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;429.mcf&#x27;</span>+dir_suffix</span><br><span class="line">mcf.executable = fullpath+<span class="string">&#x27;mcf&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># mcf.cmd = [mcf.executable] + [fullpath+&#x27;inp.in&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">mcf.cmd = [mcf.executable] + [fullpath+<span class="string">&#x27;inp.in&#x27;</span>]</span><br><span class="line"><span class="comment"># mcf.output = out_dir + &#x27;mcf.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 433.milc</span></span><br><span class="line">milc = Process(pid=<span class="number">433</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;433.milc&#x27;</span>+dir_suffix</span><br><span class="line">milc.executable = fullpath+<span class="string">&#x27;milc&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># milc.cmd = [milc.executable]</span></span><br><span class="line"><span class="comment"># milc.input = fullpath+&#x27;su3imp.in&#x27;</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">milc.cmd = [milc.executable]</span><br><span class="line">milc.<span class="built_in">input</span> = fullpath+<span class="string">&#x27;su3imp.in&#x27;</span></span><br><span class="line"><span class="comment"># milc.output = out_dir + &#x27;milc.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 434.zeusmp</span></span><br><span class="line">zeusmp = Process(pid=<span class="number">434</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;434.zeusmp&#x27;</span>+dir_suffix</span><br><span class="line">zeusmp.executable = fullpath+<span class="string">&#x27;zeusmp&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># zeusmp.cmd = [zeusmp.executable]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">zeusmp.cmd = [zeusmp.executable]</span><br><span class="line"><span class="comment"># zeusmp.output = out_dir + &#x27;zeusmp.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 435.gromacs</span></span><br><span class="line">gromacs = Process(pid=<span class="number">435</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;435.gromacs&#x27;</span>+dir_suffix</span><br><span class="line">gromacs.executable = fullpath+<span class="string">&#x27;gromacs&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># gromacs.cmd = [gromacs.executable] + [&#x27;-silent&#x27;,&#x27;-deffnm&#x27;,fullpath+ &#x27;gromacs&#x27;, &#x27;-nice&#x27;,&#x27;0&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">gromacs.cmd = [gromacs.executable] + [<span class="string">&#x27;-silent&#x27;</span>, <span class="string">&#x27;-deffnm&#x27;</span>, fullpath+<span class="string">&#x27;gromacs&#x27;</span>, <span class="string">&#x27;-nice&#x27;</span>, <span class="string">&#x27;0&#x27;</span>]</span><br><span class="line"><span class="comment"># gromacs.output = out_dir + &#x27;gromacs.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 436.cactusADM</span></span><br><span class="line">cactusADM = Process(pid=<span class="number">436</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;436.cactusADM&#x27;</span>+dir_suffix</span><br><span class="line">cactusADM.executable = fullpath+<span class="string">&#x27;cactusADM&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># cactusADM.cmd = [cactusADM.executable] + [fullpath+&#x27;benchADM.par&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">cactusADM.cmd = [cactusADM.executable] + [fullpath+<span class="string">&#x27;benchADM.par&#x27;</span>]</span><br><span class="line"><span class="comment"># cactusADM.output = out_dir + &#x27;cactusADM.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 437.leslie3d</span></span><br><span class="line">leslie3d = Process(pid=<span class="number">437</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;437.leslie3d&#x27;</span>+dir_suffix</span><br><span class="line">leslie3d.executable = fullpath+<span class="string">&#x27;leslie3d&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># leslie3d.cmd = [leslie3d.executable]</span></span><br><span class="line"><span class="comment"># leslie3d.input = fullpath+&#x27;leslie3d.in&#x27;</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">leslie3d.cmd = [leslie3d.executable]</span><br><span class="line">leslie3d.<span class="built_in">input</span> = fullpath+<span class="string">&#x27;leslie3d.in&#x27;</span></span><br><span class="line"><span class="comment"># leslie3d.output = out_dir + &#x27;leslie3d.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 444.namd</span></span><br><span class="line">namd = Process(pid=<span class="number">444</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;444.namd&#x27;</span>+dir_suffix</span><br><span class="line">namd.executable = fullpath+<span class="string">&#x27;namd&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># namd.cmd = [namd.executable] + [&#x27;--input&#x27;, fullpath+&#x27;namd.input&#x27;, &#x27;--output&#x27;, fullpath+&#x27;namd.out&#x27;, &#x27;--iterations&#x27;, &#x27;1&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">namd.cmd = [namd.executable] + [<span class="string">&#x27;--input&#x27;</span>, fullpath+<span class="string">&#x27;namd.input&#x27;</span>, <span class="string">&#x27;--output&#x27;</span>, fullpath+<span class="string">&#x27;namd.out&#x27;</span>, <span class="string">&#x27;--iterations&#x27;</span>, <span class="string">&#x27;38&#x27;</span>]</span><br><span class="line"><span class="comment"># namd.output = out_dir + &#x27;namd.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 445.gobmk</span></span><br><span class="line">gobmk = Process(pid=<span class="number">445</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;445.gobmk&#x27;</span>+dir_suffix</span><br><span class="line">gobmk.executable = fullpath+<span class="string">&#x27;gobmk&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># gobmk.cmd = [gobmk.executable] + [&#x27;--quiet&#x27;,&#x27;--mode&#x27;, &#x27;gtp&#x27;]</span></span><br><span class="line"><span class="comment"># gobmk.input = fullpath+&#x27;dniwog.tst&#x27;</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">gobmk.cmd = [gobmk.executable] + [<span class="string">&#x27;--quiet&#x27;</span>, <span class="string">&#x27;--mode&#x27;</span>, <span class="string">&#x27;gtp&#x27;</span>]</span><br><span class="line">gobmk.<span class="built_in">input</span> = fullpath+<span class="string">&#x27;13x13.tst&#x27;</span></span><br><span class="line"><span class="comment"># gobmk.cmd = [gobmk.executable] + [&#x27;--quiet&#x27;,&#x27;--mode&#x27;, &#x27;gtp&#x27;]</span></span><br><span class="line"><span class="comment"># gobmk.input = fullpath+&#x27;nngs.tst&#x27;</span></span><br><span class="line"><span class="comment"># gobmk.cmd = [gobmk.executable] + [&#x27;--quiet&#x27;,&#x27;--mode&#x27;, &#x27;gtp&#x27;]</span></span><br><span class="line"><span class="comment"># gobmk.input = fullpath+&#x27;score2.tst&#x27;</span></span><br><span class="line"><span class="comment"># gobmk.cmd = [gobmk.executable] + [&#x27;--quiet&#x27;,&#x27;--mode&#x27;, &#x27;gtp&#x27;]</span></span><br><span class="line"><span class="comment"># gobmk.input = fullpath+&#x27;trevorc.tst&#x27;</span></span><br><span class="line"><span class="comment"># gobmk.cmd = [gobmk.executable] + [&#x27;--quiet&#x27;,&#x27;--mode&#x27;, &#x27;gtp&#x27;]</span></span><br><span class="line"><span class="comment"># gobmk.input = fullpath+&#x27;trevord.tst&#x27;</span></span><br><span class="line"><span class="comment"># gobmk.output = out_dir + &#x27;gobmk.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 447.dealII</span></span><br><span class="line"><span class="comment">####### NOT WORKING #########</span></span><br><span class="line">dealII = Process(pid=<span class="number">447</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;447.dealII&#x27;</span>+dir_suffix</span><br><span class="line">dealII.executable = fullpath+<span class="string">&#x27;dealII&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment">####### NOT WORKING #########</span></span><br><span class="line">dealII.cmd = [gobmk.executable]+[<span class="string">&#x27;8&#x27;</span>]</span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line"><span class="comment">####### NOT WORKING #########</span></span><br><span class="line"><span class="comment"># dealII.output = out_dir + &#x27;dealII.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 450.soplex</span></span><br><span class="line">soplex = Process(pid=<span class="number">450</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;450.soplex&#x27;</span>+dir_suffix</span><br><span class="line">soplex.executable = fullpath+<span class="string">&#x27;soplex&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># soplex.cmd = [soplex.executable] + [&#x27;-m10000&#x27;,fullpath+ &#x27;test.mps&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">soplex.cmd = [soplex.executable] + [<span class="string">&#x27;-m45000&#x27;</span>, fullpath+<span class="string">&#x27;pds-50.mps&#x27;</span>]</span><br><span class="line"><span class="comment"># soplex.cmd = [soplex.executable] + [&#x27;-m3500&#x27;, fullpath+&#x27;ref.mps&#x27;]</span></span><br><span class="line"><span class="comment"># soplex.output = out_dir + &#x27;soplex.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 453.povray</span></span><br><span class="line">povray = Process(pid=<span class="number">453</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;453.povray&#x27;</span>+dir_suffix</span><br><span class="line">povray.executable = fullpath+<span class="string">&#x27;povray&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># povray.cmd = [povray.executable] + [fullpath+&#x27;SPEC-benchmark-test.ini&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">povray.cmd = [povray.executable] + [fullpath+<span class="string">&#x27;SPEC-benchmark-ref.ini&#x27;</span>]</span><br><span class="line"><span class="comment"># povray.output = out_dir + &#x27;povray.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 454.calculix</span></span><br><span class="line">calculix = Process(pid=<span class="number">454</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;454.calculix&#x27;</span>+dir_suffix</span><br><span class="line">calculix.executable = fullpath+<span class="string">&#x27;calculix&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># calculix.cmd = [calculix.executable] + [&#x27;-i&#x27;, &#x27;beampic&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">calculix.cmd = [calculix.executable] + [<span class="string">&#x27;-i&#x27;</span>, <span class="string">&#x27;hyperviscoplastic&#x27;</span>]</span><br><span class="line"><span class="comment"># calculix.output = out_dir + &#x27;calculix.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 456.hmmer</span></span><br><span class="line">hmmer = Process(pid=<span class="number">456</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;456.hmmer&#x27;</span>+dir_suffix</span><br><span class="line">hmmer.executable = fullpath+<span class="string">&#x27;hmmer&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># hmmer.cmd = [hmmer.executable] + [&#x27;--fixed&#x27;, &#x27;0&#x27;, &#x27;--mean&#x27;, &#x27;325&#x27;, &#x27;--num&#x27;, &#x27;45000&#x27;, &#x27;--sd&#x27;, &#x27;200&#x27;, &#x27;--seed&#x27;, &#x27;0&#x27;, fullapth+&#x27;bombesin.hmm&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">hmmer.cmd = [hmmer.executable] + [fullpath+<span class="string">&#x27;nph3.hmm&#x27;</span>, fullpath+<span class="string">&#x27;swiss41&#x27;</span>]</span><br><span class="line"><span class="comment"># hmmer.cmd = [hmmer.executable] + [&#x27;--fixed&#x27;, &#x27;0&#x27;, &#x27;--mean&#x27;, &#x27;500&#x27;, &#x27;--num&#x27;, &#x27;500000&#x27;, &#x27;--sd&#x27;, &#x27;350&#x27;, &#x27;--seed&#x27;, &#x27;0&#x27;, fullpath+&#x27;retro.hmm&#x27;]</span></span><br><span class="line"><span class="comment"># hmmer.output = out_dir + &#x27;hmmer.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 458.sjeng</span></span><br><span class="line">sjeng = Process(pid=<span class="number">458</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;458.sjeng&#x27;</span>+dir_suffix</span><br><span class="line">sjeng.executable = fullpath+<span class="string">&#x27;sjeng&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># sjeng.cmd = [sjeng.executable] + [fullpath+&#x27;test.txt&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">sjeng.cmd = [sjeng.executable] + [fullpath+<span class="string">&#x27;ref.txt&#x27;</span>]</span><br><span class="line"><span class="comment"># sjeng.output = out_dir + &#x27;sjeng.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 459.GemsFDTD</span></span><br><span class="line">GemsFDTD = Process(pid=<span class="number">459</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;459.GemsFDTD&#x27;</span>+dir_suffix</span><br><span class="line">GemsFDTD.executable = fullpath+<span class="string">&#x27;GemsFDTD&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># GemsFDTD.cmd = [GemsFDTD.executable]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">GemsFDTD.cmd = [GemsFDTD.executable]</span><br><span class="line"><span class="comment"># GemsFDTD.output = out_dir + &#x27;GemsFDTD.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 462.libquantum</span></span><br><span class="line">libquantum = Process(pid=<span class="number">462</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;462.libquantum&#x27;</span>+dir_suffix</span><br><span class="line">libquantum.executable = fullpath+<span class="string">&#x27;libquantum&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># libquantum.cmd = [libquantum.executable] + [&#x27;33&#x27;,&#x27;5&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS [UPDATE 10/2/2015]: Sparsh Mittal has pointed out the correct input for libquantum should be 1397 and 8, not 1297 and 8. Thanks!</span></span><br><span class="line">libquantum.cmd = [libquantum.executable] + [<span class="string">&#x27;1397&#x27;</span>, <span class="string">&#x27;8&#x27;</span>]</span><br><span class="line"><span class="comment"># libquantum.output = out_dir + &#x27;libquantum.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 464.h264ref</span></span><br><span class="line">h264ref = Process(pid=<span class="number">464</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;464.h264ref&#x27;</span>+dir_suffix</span><br><span class="line">h264ref.executable = fullpath+<span class="string">&#x27;h264ref&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># h264ref.cmd = [h264ref.executable] + [&#x27;-d&#x27;, fullpath+&#x27;foreman_test_encoder_baseline.cfg&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">h264ref.cmd = [h264ref.executable] + [<span class="string">&#x27;-d&#x27;</span>, fullpath+<span class="string">&#x27;foreman_ref_encoder_baseline.cfg&#x27;</span>]</span><br><span class="line"><span class="comment"># h264ref.cmd = [h264ref.executable] + [&#x27;-d&#x27;, fullpath+&#x27;foreman_ref_encoder_main.cfg&#x27;]</span></span><br><span class="line"><span class="comment"># h264ref.cmd = [h264ref.executable] + [&#x27;-d&#x27;, fullpath+&#x27;sss_encoder_main.cfg&#x27;]</span></span><br><span class="line"><span class="comment"># h264ref.output = out_dir + &#x27;h264ref.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 465.tonto</span></span><br><span class="line">tonto = Process(pid=<span class="number">465</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;465.tonto&#x27;</span>+dir_suffix</span><br><span class="line">tonto.executable = fullpath+<span class="string">&#x27;tonto&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># tonto.cmd = [tonto.executable]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">tonto.cmd = [tonto.executable]</span><br><span class="line"><span class="comment"># tonto.output = out_dir + &#x27;tonto.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 470.lbm</span></span><br><span class="line">lbm = Process(pid=<span class="number">470</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;470.lbm&#x27;</span>+dir_suffix</span><br><span class="line">lbm.executable = fullpath+<span class="string">&#x27;lbm&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># lbm.cmd = [lbm.executable] + [&#x27;20&#x27;, fullpath+&#x27;reference.dat&#x27;, &#x27;0&#x27;, &#x27;1&#x27;, fullpath+&#x27;100_100_130_cf_a.of&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">lbm.cmd = [lbm.executable] + [<span class="string">&#x27;300&#x27;</span>, fullpath+<span class="string">&#x27;reference.dat&#x27;</span>, <span class="string">&#x27;0&#x27;</span>, <span class="string">&#x27;0&#x27;</span>, fullpath+<span class="string">&#x27;100_100_130_ldc.of&#x27;</span>]</span><br><span class="line"><span class="comment"># lbm.output = out_dir + &#x27;lbm.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 471.omnetpp</span></span><br><span class="line">omnetpp = Process(pid=<span class="number">471</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;471.omnetpp&#x27;</span>+dir_suffix</span><br><span class="line">omnetpp.executable = fullpath+<span class="string">&#x27;omnetpp&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># omnetpp.cmd = [omnetpp.executable] + [fullpath+&#x27;omnetpp.ini&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">omnetpp.cmd = [omnetpp.executable] + [fullpath+<span class="string">&#x27;omnetpp.ini&#x27;</span>]</span><br><span class="line"><span class="comment"># omnetpp.output = out_dir + &#x27;omnetpp.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 473.astar</span></span><br><span class="line">astar = Process(pid=<span class="number">473</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;473.astar&#x27;</span>+dir_suffix</span><br><span class="line">astar.executable = fullpath+<span class="string">&#x27;astar&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># astar.cmd = [astar.executable] + [fullpath+&#x27;lake.cfg&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">astar.cmd = [astar.executable] + [fullpath+<span class="string">&#x27;rivers.cfg&#x27;</span>]</span><br><span class="line"><span class="comment"># astar.output = out_dir + &#x27;astar.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 481.wrf</span></span><br><span class="line">wrf = Process(pid=<span class="number">481</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;481.wrf&#x27;</span>+dir_suffix</span><br><span class="line">wrf.executable = fullpath+<span class="string">&#x27;wrf&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># wrf.cmd = [wrf.executable]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">wrf.cmd = [wrf.executable]</span><br><span class="line"><span class="comment"># wrf.output = out_dir + &#x27;wrf.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 482.sphinx3</span></span><br><span class="line">sphinx3 = Process(pid=<span class="number">482</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;482.sphinx3&#x27;</span>+dir_suffix</span><br><span class="line">sphinx3.executable = fullpath+<span class="string">&#x27;sphinx_livepretend&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># sphinx3.cmd = [sphinx3.executable] + [fullpath+&#x27;ctlfile&#x27;, fullpath, fullpath+&#x27;args.an4&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">sphinx3.cmd = [sphinx3.executable] + [fullpath+<span class="string">&#x27;ctlfile&#x27;</span>, fullpath, fullpath+<span class="string">&#x27;args.an4&#x27;</span>]</span><br><span class="line"><span class="comment"># sphinx3.output = out_dir + &#x27;sphinx3.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 483.xalancbmk</span></span><br><span class="line"><span class="comment">######## NOT WORKING ###########</span></span><br><span class="line">xalancbmk = Process(pid=<span class="number">483</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;483.xalancbmk&#x27;</span>+dir_suffix</span><br><span class="line">xalancbmk.executable = fullpath+<span class="string">&#x27;Xalan&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment">######## NOT WORKING ###########</span></span><br><span class="line">xalancbmk.cmd = [xalancbmk.executable] + [<span class="string">&#x27;-v&#x27;</span>,fullpath+<span class="string">&#x27;test.xml&#x27;</span>,fullpath+<span class="string">&#x27;xalanc.xsl&#x27;</span>]</span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line"><span class="comment">######## NOT WORKING ###########</span></span><br><span class="line"><span class="comment"># xalancbmk.output = out_dir + &#x27;xalancbmk.out&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 998.specrand</span></span><br><span class="line">specrand_i = Process(pid=<span class="number">998</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProcess()</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;998.specrand&#x27;</span>+dir_suffix</span><br><span class="line">specrand_i.executable = fullpath+<span class="string">&#x27;specrand&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># specrand_i.cmd = [specrand_i.executable] + [&#x27;324342&#x27;, &#x27;24239&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">specrand_i.cmd = [specrand_i.executable] + [<span class="string">&#x27;1255432124&#x27;</span>, <span class="string">&#x27;234923&#x27;</span>]</span><br><span class="line"><span class="comment"># specrand_i.output = out_dir + &#x27;specrand_i.out&#x27;</span></span><br><span class="line"><span class="comment"># 999.specrand</span></span><br><span class="line">specrand_f = Process(pid=<span class="number">999</span>)  <span class="comment"># Update June 7, 2017: This used to be LiveProces using std::in;</span></span><br><span class="line">fullpath=SPEC_DIR+<span class="string">&#x27;999.specrand&#x27;</span>+dir_suffix</span><br><span class="line">specrand_f.executable = fullpath+<span class="string">&#x27;specrand&#x27;</span> + exe_suffix</span><br><span class="line"><span class="comment"># TEST CMDS</span></span><br><span class="line"><span class="comment"># specrand_f.cmd = [specrand_f.executable] + [&#x27;324342&#x27;, &#x27;24239&#x27;]</span></span><br><span class="line"><span class="comment"># REF CMDS</span></span><br><span class="line">specrand_f.cmd = [specrand_f.executable] + [<span class="string">&#x27;1255432124&#x27;</span>, <span class="string">&#x27;234923&#x27;</span>]</span><br><span class="line"><span class="comment"># specrand_f.output = out_dir + &#x27;specrand_f.out&#x27;</span></span><br></pre></td></tr></table></figure>

<p>修改之后，可以通过</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="built_in">cd</span> <span class="variable">$PATH_TO_YOUR_GEM5_INSTALL</span>  </span><br><span class="line">build/ARCH/gem5.opt [gem5 options] config/example/spe06_config.py  [script options] --benchmark=YOUR_BENCH</span><br></pre></td></tr></table></figure>

<p>指定对应的bench来运行。为了使运行更简单。分别为运行写了单线程和多线程版本。</p>
<h4 id="单线程运行"><a href="#单线程运行" class="headerlink" title="单线程运行"></a><strong>单线程运行</strong></h4><figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># run_spec2006.sh</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># This program is free software: you can redistribute it and/or modify</span></span><br><span class="line"><span class="comment"># it under the terms of the GNU General Public License as published by</span></span><br><span class="line"><span class="comment"># the Free Software Foundation, either version 3 of the License, or</span></span><br><span class="line"><span class="comment"># (at your option) any later version.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># This program is distributed in the hope that it will be useful,</span></span><br><span class="line"><span class="comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span></span><br><span class="line"><span class="comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></span><br><span class="line"><span class="comment"># GNU General Public License for more details.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># You should have received a copy of the GNU General Public License</span></span><br><span class="line"><span class="comment"># along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">############ DIRECTORY VARIABLES: MODIFY ACCORDINGLY #############</span></span><br><span class="line">GEM5_DIR=/home/tom/gem5</span><br><span class="line"><span class="comment">#&lt;PATH_TO_YOUR_GEM5_INSTALL&gt;                          # Install location of gem5</span></span><br><span class="line">SPEC_DIR=/home/tom/cpu2006</span><br><span class="line"><span class="comment">#&lt;PATH_TO_YOUR_SPEC_CPU2006_INSTALL&gt;                  # Install location of your SPEC2006 benchmarks</span></span><br><span class="line"></span><br><span class="line">ARCH=X86</span><br><span class="line"><span class="comment">#YOUR gem5 arch</span></span><br><span class="line"><span class="comment">##################################################################</span></span><br><span class="line"></span><br><span class="line">ARGC=<span class="variable">$#</span> <span class="comment"># Get number of arguments excluding arg0 (the script itself). Check for help message condition.</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$ARGC</span>&quot;</span> != 2 ]]; <span class="keyword">then</span> <span class="comment"># Bad number of arguments.</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;run_gem5_alpha_spec06_benchmark.sh  Copyright (C) 2014 Mark Gottscho&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;This program comes with ABSOLUTELY NO WARRANTY; for details see &lt;http://www.gnu.org/licenses/&gt;.&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;This is free software, and you are welcome to redistribute it under certain conditions; see &lt;http://www.gnu.org/licenses/&gt; for details.&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;This script runs a single gem5 simulation of a single SPEC CPU2006 benchmark for Alpha ISA.&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;USAGE: run_gem5_alpha_spec06_benchmark.sh &lt;BENCHMARK&gt; &lt;OUTPUT_DIR&gt;&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;EXAMPLE: ./run_gem5_alpha_spec06_benchmark.sh bzip2 /FULL/PATH/TO/output_dir&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;&quot;</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;A single --help help or -h argument will bring this message back.&quot;</span></span><br><span class="line">    <span class="built_in">exit</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Get command line input. We will need to check these.</span></span><br><span class="line">BENCHMARK=<span class="variable">$1</span>                    <span class="comment"># Benchmark name, e.g. bzip2</span></span><br><span class="line">OUTPUT_DIR=<span class="variable">$2</span>                   <span class="comment"># Directory to place run output. Make sure this exists!</span></span><br><span class="line">RUN_SUFFIX=run/run_base_ref_amd64-m64-gcc43-nn.0000</span><br><span class="line"><span class="comment">######################### BENCHMARK CODENAMES ####################</span></span><br><span class="line">PERLBENCH_CODE=400.perlbench</span><br><span class="line">BZIP2_CODE=401.bzip2</span><br><span class="line">GCC_CODE=403.gcc</span><br><span class="line">BWAVES_CODE=410.bwaves</span><br><span class="line">GAMESS_CODE=416.gamess</span><br><span class="line">MCF_CODE=429.mcf</span><br><span class="line">MILC_CODE=433.milc</span><br><span class="line">ZEUSMP_CODE=434.zeusmp</span><br><span class="line">GROMACS_CODE=435.gromacs</span><br><span class="line">CACTUSADM_CODE=436.cactusADM</span><br><span class="line">LESLIE3D_CODE=437.leslie3d</span><br><span class="line">NAMD_CODE=444.namd</span><br><span class="line">GOBMK_CODE=445.gobmk</span><br><span class="line">DEALII_CODE=447.dealII</span><br><span class="line">SOPLEX_CODE=450.soplex</span><br><span class="line">POVRAY_CODE=453.povray</span><br><span class="line">CALCULIX_CODE=454.calculix</span><br><span class="line">HMMER_CODE=456.hmmer</span><br><span class="line">SJENG_CODE=458.sjeng</span><br><span class="line">GEMSFDTD_CODE=459.GemsFDTD</span><br><span class="line">LIBQUANTUM_CODE=462.libquantum</span><br><span class="line">H264REF_CODE=464.h264ref</span><br><span class="line">TONTO_CODE=465.tonto</span><br><span class="line">LBM_CODE=470.lbm</span><br><span class="line">OMNETPP_CODE=471.omnetpp</span><br><span class="line">ASTAR_CODE=473.astar</span><br><span class="line">WRF_CODE=481.wrf</span><br><span class="line">SPHINX3_CODE=482.sphinx3</span><br><span class="line">XALANCBMK_CODE=483.xalancbmk</span><br><span class="line">SPECRAND_INT_CODE=998.specrand</span><br><span class="line">SPECRAND_FLOAT_CODE=999.specrand</span><br><span class="line"><span class="comment">##################################################################</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Check BENCHMARK input</span></span><br><span class="line"><span class="comment">#################### BENCHMARK CODE MAPPING ######################</span></span><br><span class="line">BENCHMARK_CODE=<span class="string">&quot;none&quot;</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;perlbench&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$PERLBENCH_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;bzip2&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$BZIP2_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;gcc&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$GCC_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;bwaves&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$BWAVES_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;gamess&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$GAMESS_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;mcf&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$MCF_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;milc&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$MILC_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;zeusmp&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$ZEUSMP_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;gromacs&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$GROMACS_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;cactusADM&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$CACTUSADM_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;leslie3d&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$LESLIE3D_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;namd&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$NAMD_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;gobmk&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$GOBMK_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;dealII&quot;</span> ]]; <span class="keyword">then</span> <span class="comment"># DOES NOT WORK</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$DEALII_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;soplex&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$SOPLEX_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;povray&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$POVRAY_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;calculix&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$CALCULIX_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;hmmer&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$HMMER_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;sjeng&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$SJENG_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;GemsFDTD&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$GEMSFDTD_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;libquantum&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$LIBQUANTUM_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;h264ref&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$H264REF_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;tonto&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$TONTO_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;lbm&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$LBM_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;omnetpp&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$OMNETPP_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;astar&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$ASTAR_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;wrf&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$WRF_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;sphinx3&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$SPHINX3_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;xalancbmk&quot;</span> ]]; <span class="keyword">then</span> <span class="comment"># DOES NOT WORK</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$XALANCBMK_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;specrand_i&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$SPECRAND_INT_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK</span>&quot;</span> == <span class="string">&quot;specrand_f&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    BENCHMARK_CODE=<span class="variable">$SPECRAND_FLOAT_CODE</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="comment"># Sanity check</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="string">&quot;<span class="variable">$BENCHMARK_CODE</span>&quot;</span> == <span class="string">&quot;none&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;Input benchmark selection <span class="variable">$BENCHMARK</span> did not match any known SPEC CPU2006 benchmarks! Exiting.&quot;</span></span><br><span class="line">    <span class="built_in">exit</span> 1</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment">##################################################################</span></span><br><span class="line"><span class="comment"># Check OUTPUT_DIR existence</span></span><br><span class="line"><span class="keyword">if</span> [[ ! -d <span class="string">&quot;<span class="variable">$OUTPUT_DIR</span>&quot;</span> ]]; <span class="keyword">then</span></span><br><span class="line">    <span class="built_in">echo</span> <span class="string">&quot;Output directory <span class="variable">$OUTPUT_DIR</span> does not exist! Exiting.&quot;</span></span><br><span class="line">    <span class="built_in">exit</span> 1</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line">RUN_DIR=<span class="variable">$SPEC_DIR</span>/benchspec/CPU2006/<span class="variable">$BENCHMARK_CODE</span>/<span class="variable">$RUN_SUFFIX</span>     <span class="comment"># Run directory for the selected SPEC benchmark</span></span><br><span class="line">SCRIPT_OUT=<span class="variable">$OUTPUT_DIR</span>/runscript.log                                                                    <span class="comment"># File log for this script&#x27;s stdout henceforth</span></span><br><span class="line"></span><br><span class="line"><span class="comment">################## REPORT SCRIPT CONFIGURATION ###################</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;Command line:&quot;</span>                                | tee <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;<span class="variable">$0</span> $*&quot;</span>                                        | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;================= Hardcoded directories ==================&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;GEM5_DIR:                                     <span class="variable">$GEM5_DIR</span>&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;SPEC_DIR:                                     <span class="variable">$SPEC_DIR</span>&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;==================== Script inputs =======================&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;BENCHMARK:                                    <span class="variable">$BENCHMARK</span>&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;OUTPUT_DIR:                                   <span class="variable">$OUTPUT_DIR</span>&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;==========================================================&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="comment">##################################################################</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#################### LAUNCH GEM5 SIMULATION ######################</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;--------- Here goes nothing! Starting gem5! ------------&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;&quot;</span> | tee -a <span class="variable">$SCRIPT_OUT</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Actually launch gem5!</span></span><br><span class="line"><span class="comment">##根据需要对此进行修改</span></span><br><span class="line"></span><br><span class="line"><span class="variable">$GEM5_DIR</span>/build/<span class="variable">$ARCH</span>/gem5.opt \</span><br><span class="line">--debug-flags=MemoryAccess \</span><br><span class="line">--outdir=<span class="variable">$OUTPUT_DIR</span> \</span><br><span class="line">--debug-file=<span class="variable">$&#123;BENCHMARK&#125;</span>.out \</span><br><span class="line"><span class="variable">$GEM5_DIR</span>/configs/tutorial/spec06_config.py \</span><br><span class="line">--benchmark=<span class="variable">$BENCHMARK</span> \</span><br><span class="line">--benchmark_stdout=<span class="variable">$OUTPUT_DIR</span>/<span class="variable">$BENCHMARK</span>.out \</span><br><span class="line">--benchmark_stderr=<span class="variable">$OUTPUT_DIR</span>/<span class="variable">$BENCHMARK</span>.err \</span><br><span class="line">--num-cpus=1 \</span><br><span class="line">--cpu-type=TimingSimpleCPU \</span><br><span class="line">--cpu-clock=2.4GHz \</span><br><span class="line">--caches \</span><br><span class="line">--cacheline_size=64 \</span><br><span class="line">--l1d_size=64kB --l1i_size=32kB --l1i_assoc=8 --l1d_assoc=8 \</span><br><span class="line">--l2cache --l2_size=2MB --l2_assoc=8 \</span><br><span class="line">--l3_size=32MB --l3_assoc=4 \</span><br><span class="line">--ruby \</span><br><span class="line">--mem-type=DDR4_2400_8x8 \</span><br><span class="line">--mem-channels=2 \</span><br><span class="line">--mem-ranks=8 \</span><br><span class="line">--mem-size=4096MB -I 2000000 \</span><br><span class="line">| tee -a <span class="variable">$SCRIPT_OUT</span></span><br></pre></td></tr></table></figure>

<p>可以使用如下命令单线程运行gem5仿真</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="built_in">cd</span> <span class="variable">$PATH_TO_YOUR_GEM5_INSTALL</span>  </span><br><span class="line">./run_spec2006.sh  &lt;BENCHMARK_NAME&gt;  &lt;FULL_PATH_TO_OUT_DIRECTORY&gt;</span><br></pre></td></tr></table></figure>

<h4 id="多线程运行"><a href="#多线程运行" class="headerlink" title="多线程运行"></a><strong>多线程运行</strong></h4><p>对上面的run_spec2006.sh进行修改最后的部分，得到多线程版本的脚本。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="comment"># Actually launch gem5!</span></span><br><span class="line"><span class="variable">$GEM5_DIR</span>/build/<span class="variable">$ARCH</span>/gem5.opt \</span><br><span class="line">--debug-flags=MemoryAccess \</span><br><span class="line">--outdir=<span class="variable">$OUTPUT_DIR</span> \</span><br><span class="line">--debug-file=<span class="variable">$&#123;BENCHMARK&#125;</span>.out \</span><br><span class="line"><span class="variable">$GEM5_DIR</span>/configs/tutorial/spec06_config.py \</span><br><span class="line">--benchmark=<span class="variable">$BENCHMARK</span> \</span><br><span class="line">--benchmark_stdout=<span class="variable">$OUTPUT_DIR</span>/<span class="variable">$BENCHMARK</span>.out \</span><br><span class="line">--benchmark_stderr=<span class="variable">$OUTPUT_DIR</span>/<span class="variable">$BENCHMARK</span>.err \</span><br><span class="line">--num-cpus=4 \</span><br><span class="line">--cpu-type=DerivO3CPU \</span><br><span class="line">--cpu-clock=2.4GHz \</span><br><span class="line">--caches \</span><br><span class="line">--cacheline_size=64 \</span><br><span class="line">--l1d_size=64kB --l1i_size=32kB --l1i_assoc=8 --l1d_assoc=8 \</span><br><span class="line">--l2cache --l2_size=2MB --l2_assoc=8 \</span><br><span class="line">--l3_size=32MB --l3_assoc=4 \</span><br><span class="line">--ruby \</span><br><span class="line">--mem-type=DDR4_2400_8x8 \</span><br><span class="line">--mem-channels=2 \</span><br><span class="line">--mem-ranks=8 \</span><br><span class="line">--mem-size=4096MB -I 2000000 \</span><br><span class="line">| tee -a <span class="variable">$SCRIPT_OUT</span></span><br></pre></td></tr></table></figure>

<p>可以使用如下命令单线程运行gem5仿真</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="built_in">cd</span> <span class="variable">$PATH_TO_YOUR_GEM5_INSTALL</span>  </span><br><span class="line">./run_spec2006.sh  &lt;BENCHMARK_NAME1;BENCHMARK_NAME2;BENCHMARK_NAME3;BENCHMARK_NAME4&gt;  &lt;FULL_PATH_TO_OUT_DIRECTORY&gt;</span><br></pre></td></tr></table></figure>

<p>bench间使用”;”分隔。</p>
<p>参考：</p>
<p><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-ejrcfcvw-rb.html">http://www.voidcn.com/article/p-ejrcfcvw-rb.html</a><br><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-nyjntyku-qo.html">http://www.voidcn.com/article/p-nyjntyku-qo.html</a><br><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-waqmaqjn-rb.html">http://www.voidcn.com/article/p-waqmaqjn-rb.html</a><br><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-kmdrrpzd-qo.html">http://www.voidcn.com/article/p-kmdrrpzd-qo.html</a><br><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-akuksawb-qo.html">http://www.voidcn.com/article/p-akuksawb-qo.html</a><br><a target="_blank" rel="noopener" href="http://www.voidcn.com/article/p-ejrcfcvw-rb.html">http://www.voidcn.com/article/p-ejrcfcvw-rb.html</a><br><a target="_blank" rel="noopener" href="https://markgottscho.wordpress.com/2014/09/20/tutorial-easily-running-spec-cpu2006-benchmarks-in-the-gem5-simulator/">https://markgottscho.wordpress.com/2014/09/20/tutorial-easily-running-spec-cpu2006-benchmarks-in-the-gem5-simulator/</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Tom</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://tomsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/">https://tomsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://TOMsworkspace.github.io" target="_blank">Tom's develop Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/GEM5/">GEM5</a><a class="post-meta__tags" href="/tags/CCPU2006/">CCPU2006</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5运行SPECCPU2006benchmark/figure2.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏<div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/wp.jpg" target="_blank"><img class="post-qr-code-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/wp.jpg" alt="wechat"/></a><div class="post-qr-code-desc">wechat</div></li></ul></div></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/09/23/gem5%E8%8E%B7%E5%8F%96bench%E7%9A%84%E8%AE%BF%E9%97%AE%E5%86%85%E5%AD%98%E4%BF%A1%E6%81%AF/"><img class="prev-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/23/gem5获取bench的访问内存信息/figure1.png" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">gem5获取bench的访问内存信息</div></div></a></div><div class="next-post pull-right"><a href="/2020/08/05/%E5%80%BC%E5%BE%97%E6%8E%A8%E8%8D%90%E7%9A%84C%E4%B8%8EC++%E6%A1%86%E6%9E%B6%E5%92%8C%E5%BA%93/"><img class="next-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper/值得推荐的C与C++框架和库/figure1.jpeg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">值得推荐的C与C++框架和库</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2020/10/11/gem5运行SPECCPU2017benchmark/" title="gem5运行SPECCPU2017benchmark"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5运行SPECCPU2017benchmark/figure2.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-10-11</div><div class="title">gem5运行SPECCPU2017benchmark</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avator.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">Tom</div><div class="author-info__description">keep curiously!</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">38</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">73</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/TOMsworkspace"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/TOMsworkspace" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:cqucscw@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#gem5%E8%BF%90%E8%A1%8CSPECCPU-2006benchmark"><span class="toc-number">1.</span> <span class="toc-text">gem5运行SPECCPU 2006benchmark</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-number">1.1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"><span class="toc-number">1.2.</span> <span class="toc-text">系统环境配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85"><span class="toc-number">1.3.</span> <span class="toc-text">编译安装</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8D%8F%E5%90%8C%E4%BB%BF%E7%9C%9F"><span class="toc-number">1.4.</span> <span class="toc-text">协同仿真</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#gem5-SE-FS-%E4%BB%BF%E7%9C%9F%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.4.1.</span> <span class="toc-text">gem5 SE&#x2F;FS 仿真模式</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E4%BB%BF%E7%9C%9F%E7%9A%84%E6%A0%BC%E5%BC%8F"><span class="toc-number">1.4.1.1.</span> <span class="toc-text">运行仿真的格式</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#gem5-Options"><span class="toc-number">1.4.1.2.</span> <span class="toc-text">gem5 Options</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Script-Options"><span class="toc-number">1.4.1.3.</span> <span class="toc-text">Script Options</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#spec-cpu2006%E9%9D%99%E6%80%81%E7%BC%96%E8%AF%91"><span class="toc-number">1.4.2.</span> <span class="toc-text">spec cpu2006静态编译</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E4%B8%80%E4%B8%AA%E4%BE%8B%E5%AD%90"><span class="toc-number">1.4.3.</span> <span class="toc-text">运行一个例子</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#runspec%E8%BF%90%E8%A1%8C"><span class="toc-number">1.4.3.1.</span> <span class="toc-text">runspec运行</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BA%8C%E8%BF%9B%E5%88%B6%E8%BF%90%E8%A1%8C"><span class="toc-number">1.4.3.2.</span> <span class="toc-text">二进制运行</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#GEM5%E8%BF%90%E8%A1%8C"><span class="toc-number">1.4.3.3.</span> <span class="toc-text">GEM5运行</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC"><span class="toc-number">1.4.4.</span> <span class="toc-text">自动化脚本</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6spec06-config-py"><span class="toc-number">1.4.4.1.</span> <span class="toc-text">配置文件spec06_config.py</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#bench%E8%BE%93%E5%85%A5"><span class="toc-number">1.4.4.2.</span> <span class="toc-text">bench输入</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8D%95%E7%BA%BF%E7%A8%8B%E8%BF%90%E8%A1%8C"><span class="toc-number">1.4.4.3.</span> <span class="toc-text">单线程运行</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%9A%E7%BA%BF%E7%A8%8B%E8%BF%90%E8%A1%8C"><span class="toc-number">1.4.4.4.</span> <span class="toc-text">多线程运行</span></a></li></ol></li></ol></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/09/27/%E6%B5%81%E4%BD%93%E6%A8%A1%E6%8B%9F%E4%B8%8ESPH%E6%96%B9%E6%B3%95/" title="流体模拟与SPH方法"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/09/27/流体模拟与SPH方法/figure1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="流体模拟与SPH方法"/></a><div class="content"><a class="title" href="/2021/09/27/%E6%B5%81%E4%BD%93%E6%A8%A1%E6%8B%9F%E4%B8%8ESPH%E6%96%B9%E6%B3%95/" title="流体模拟与SPH方法">流体模拟与SPH方法</a><time datetime="2021-09-27T08:46:17.000Z" title="发表于 2021-09-27 16:46:17">2021-09-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/09/11/%E5%BC%B9%E6%80%A7%E6%9C%89%E9%99%90%E5%85%83%E6%96%B9%E6%B3%95/" title="弹性有限元方法"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/09/11/弹性有限元方法/figure1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="弹性有限元方法"/></a><div class="content"><a class="title" href="/2021/09/11/%E5%BC%B9%E6%80%A7%E6%9C%89%E9%99%90%E5%85%83%E6%96%B9%E6%B3%95/" title="弹性有限元方法">弹性有限元方法</a><time datetime="2021-09-11T09:05:34.000Z" title="发表于 2021-09-11 17:05:34">2021-09-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/09/%E5%BC%B9%E7%B0%A7%E8%B4%A8%E7%82%B9%E7%B3%BB%E7%BB%9F%E4%B8%8E%E6%97%B6%E9%97%B4%E7%A7%AF%E5%88%86/" title="弹簧质点系统与时间积分"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/09/弹簧质点系统与时间积分/figure1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="弹簧质点系统与时间积分"/></a><div class="content"><a class="title" href="/2021/08/09/%E5%BC%B9%E7%B0%A7%E8%B4%A8%E7%82%B9%E7%B3%BB%E7%BB%9F%E4%B8%8E%E6%97%B6%E9%97%B4%E7%A7%AF%E5%88%86/" title="弹簧质点系统与时间积分">弹簧质点系统与时间积分</a><time datetime="2021-08-09T13:39:12.000Z" title="发表于 2021-08-09 21:39:12">2021-08-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/08/OpenGL%E5%9D%90%E6%A0%87%E7%B3%BB%E7%BB%9F/" title="OpenGL坐标系统"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/08/OpenGL坐标系统/figure1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="OpenGL坐标系统"/></a><div class="content"><a class="title" href="/2021/08/08/OpenGL%E5%9D%90%E6%A0%87%E7%B3%BB%E7%BB%9F/" title="OpenGL坐标系统">OpenGL坐标系统</a><time datetime="2021-08-08T12:57:28.000Z" title="发表于 2021-08-08 20:57:28">2021-08-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/06/Doxygen%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%96%87%E6%A1%A3/" title="Doxygen自动生成文档"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/06/Doxygen自动生成文档/Doxygen.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Doxygen自动生成文档"/></a><div class="content"><a class="title" href="/2021/08/06/Doxygen%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%96%87%E6%A1%A3/" title="Doxygen自动生成文档">Doxygen自动生成文档</a><time datetime="2021-08-06T13:24:50.000Z" title="发表于 2021-08-06 21:24:50">2021-08-06</time></div></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2021 By Tom</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a href="https://TOMsworkspace.github.io/">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module" defer></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    loader: {
      source: {
        '[tex]/amsCd': '[tex]/amscd'
      }
    },
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        addClass: [200,() => {
          document.querySelectorAll('mjx-container:not([display=\'true\']').forEach( node => {
            const target = node.parentNode
            if (!target.classList.contains('has-jax')) {
              target.classList.add('mathjax-overflow')
            }
          })
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"><script src="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css"><script>$(function () {
  $('span.katex-display').wrap('<div class="katex-wrap"></div>')
})</script><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk({
      clientID: 'e50742231659674c31e3',
      clientSecret: '59038139e289bc384e484d341205bbb95a123209',
      repo: 'TOMsworkspace.github.io',
      owner: 'TOMsworkspace',
      admin: ['TOMsworkspace'],
      id: 'd1fa2fae934a988254e54cdfdbf380b5',
      language: '-zh-CN# en, zh-CN, zh-TW, es-ES, fr, ru',
      perPage: 10,
      distractionFreeMode: false,
      pagerDirection: 'last',
      createIssueManually: true,
      updateCountCallback: commentCount
    })
    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    $.getScript('https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js', initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !false) {
  if (false) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" async="async" mobile="false"></script><script>(function(){
  const bp = document.createElement('script');
  const curProtocol = window.location.protocol.split(':')[0];
  if (curProtocol === 'https'){
  bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
  bp.dataset.pjax = ''
  const s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(bp, s);
})()</script></div></body></html>